import sys
from math import *


# def ExpCalcBot(string):
#     try:
#         print('Your answer is', eval(string))
#     except NameError:
#         print('The expression you enter is not valid')
#
#
# print('Hi I am ExpCalcBot. Please input your expression or enter e to end')
#
# while 1:
#     print('Please enter a number or operation. Enter c to complete. :')
#     inputstr = input()
#     if inputstr == str('e'):
#         sys.exit()
#     elif repr(inputstr) != repr(''):
#         ExpCalcBot(inputstr)
#         inputstr = ''

#
# 如果使用对象不是信任源，应该尽量避免使用eval，在需要使用可用安全性更好的ast.literal_eval
# 所以出于安全考虑，对字符串进行类型转换的时候，最好使用ast.literal_eval()函数!
# ast abstract syntax trees
#
import ast

print(ast.literal_eval('[1, 2, 3]'))
